﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShopBegin.aspx.cs" Inherits="ShopBegin" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>店铺资料</title>
    <script src="../js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
    <script>
        var edit2 = function (editor, e) {

            // Call DirectMethod
            if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
                CompanyX.Edit2(e.record.data.ShopCode, e.field, e.originalValue, e.value, e.record.data);
            }
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Crisp" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="ColumnLayout">
                            <Items>
                                <ext:TextField runat="server"  ID="txtshop" EmptyText="输入店铺编号/名称" LabelWidth="60" FieldLabel="店铺"/>
                                <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Component  runat="server" Width="1500" Margin="3"/>
                                <ext:Button ID="Button3" runat="server" Text="加载店铺信息" OnDirectClick="BtnGetUser" UI="Danger">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="ShopCode">
                                    <Fields>
                                        <ext:ModelField Name="ShopCode" Mapping="店铺代码" />
                                        <ext:ModelField Name="ShopName" Mapping="店铺简称" />
                                        <ext:ModelField Name="infoname" Mapping="店铺属性" />
                                        <ext:ModelField Name="AccountName" Mapping="收款人姓名" />
                                        <ext:ModelField Name="AccountCode" Mapping="收款帐号" />
                                        <ext:ModelField Name="AccountBank" Mapping="开户银行" />
                                        <ext:ModelField Name="CwLinker" Mapping="财务联系人" />
                                        <ext:ModelField Name="CwMobile" Mapping="财务联系电话" />
                                        <ext:ModelField Name="BgMoney" Mapping="期初金额" />
                                        <ext:ModelField Name="FcfzRate" Mapping="服装比例" />
                                        <ext:ModelField Name="FcxRate" Mapping="鞋比例" />
                                        <ext:ModelField Name="FcpjRate" Mapping="配件比例" />
                                        <ext:ModelField Name="FclpRate" Mapping="礼品比例" />
                                        <ext:ModelField Name="ExpenRate" Mapping="费用比例" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:Column ID="Column1" runat="server" Text="店铺代码" DataIndex="ShopCode" />
                            <ext:Column ID="Column2" runat="server" Text="店铺简称" DataIndex="ShopName" Width="180" />
                            <ext:Column ID="Column14" runat="server" Text="店铺属性" DataIndex="infoname" Width="80" />
                              <ext:Column ID="Column9" runat="server" Text="收款人姓名" DataIndex="AccountName">
                                <Editor>
                                    <ext:TextField ID="TextField7" runat="server" EmptyText="收款人姓名" />
                                </Editor>
                            </ext:Column>
                              <ext:Column ID="Column10" runat="server" Text="收款帐号" DataIndex="AccountCode">
                                <Editor>
                                    <ext:TextField ID="TextField8" runat="server" EmptyText="收款帐号" />
                                </Editor>
                            </ext:Column>
                              <ext:Column ID="Column11" runat="server" Text="开户银行" DataIndex="AccountBank">
                                <Editor>
                                    <ext:TextField ID="TextField9" runat="server" EmptyText="开户银行" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column12" runat="server" Text="财务联系人" DataIndex="CwLinker">
                                <Editor>
                                    <ext:TextField ID="TextField10" runat="server" EmptyText="财务联系人" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column13" runat="server" Text="财务联系电话" DataIndex="CwMobile">
                                <Editor>
                                    <ext:TextField ID="TextField11" runat="server" EmptyText="财务联系电话" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column3" runat="server" Text="期初金额" DataIndex="BgMoney">
                                <Editor>
                                    <ext:TextField ID="TextField1" runat="server" EmptyText="输入期初" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column4" runat="server" Text="服装比例" DataIndex="FcfzRate">
                                <Editor>
                                    <ext:TextField ID="TextField2" runat="server" EmptyText="服装比例" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column5" runat="server" Text="鞋比例" DataIndex="FcxRate">
                                <Editor>
                                    <ext:TextField ID="TextField3" runat="server" EmptyText="鞋比例" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column6" runat="server" Text="配件比例" DataIndex="FcpjRate">
                                <Editor>
                                    <ext:TextField ID="TextField4" runat="server" EmptyText="配件比例" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column7" runat="server" Text="礼品比例" DataIndex="FclpRate">
                                <Editor>
                                    <ext:TextField ID="TextField5" runat="server" EmptyText="礼品比例" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column8" runat="server" Text="费用比例" DataIndex="ExpenRate">
                                <Editor>
                                    <ext:TextField ID="TextField6" runat="server" EmptyText="费用比例" />
                                </Editor>
                            </ext:Column>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <Plugins>
                        <ext:CellEditing ID="CellEditing1" runat="server">
                            <Listeners>
                                <Edit Fn="edit2" />
                            </Listeners>
                        </ext:CellEditing>
                    </Plugins>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="10" />
                                        <ext:ListItem Text="20" />
                                        <ext:ListItem Text="50" />
                                        <ext:ListItem Text="100" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="50" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
